package com.czk.rdd.operator.transform

import org.apache.spark.{SparkConf, SparkContext}

/**
 * @Author:ChenZhangKun
 * @Date: 2021/12/9 11:33
 */
object Spark07_RDD_Operator_Transform {
  def main(args: Array[String]): Unit = {
    val sparkConf = new SparkConf().setMaster("local[*]").setAppName("RDD")
    val sc = new SparkContext(sparkConf)

    val rdd = sc.makeRDD(List(List(1,2),List(3,4)))

    // flateMap算子，扁平化处理
    // 要求返回可迭代的集合
    val flatRdd = rdd.flatMap(
      list => {
        list
      }
    )
    flatRdd.collect().foreach(println)



  }
}
